<div class="pa clearfix">
  <div>
    <h3>用户留言</h3>
    <hr/>
    <div>
      <table>
        <tr>
          <th>Id</th>
          <th>用户</th>
          <th>留言</th>
          <th>时间</th>
          <th>操作</th>
        </tr>
        <% @feedbacks.each do |feedback| %>
          <tr>
            <td><%= feedback.id %></td>
            <td><%= feedback.user.name||feedback.user.email %></td>
            <td><%= feedback.content %></td>
            <td><%= feedback.created_at.strftime('%Y-%m-%d %H:%M:%S') %></td>
            <td>
              <%= link_to '删除', "/feedbacks/delete/#{feedback.id}", :confirm => '你确定要删除吗？' %> |
              <%= link_to '回复', "/replies/new/#{feedback.id}.feedback", :class => 'reply' %>
            </td>
          </tr>
          <% feedback.replies.each do |reply| %>
            <tr>
              <td></td>
              <td>回复：</td>
              <td>
                <%= reply.content %>
              </td>
              <td><%= reply.created_at.strftime('%Y-%m-%d %H:%M:%S') %></td>
              <td>
                <%= link_to '删除', "/replys/delete/#{reply.id}", :confirm => '你确定要删除吗？' %>
              </td>
            </tr>
          <% end %>
        <% end %>
      </table>
      <div class="c666">
        <%= will_paginate @feedbacks %>
      </div>
    </div>
  </div>
</div>